package com.one.blocks.rbac.manager;

import com.one.blocks.mvc.manager.AbstractBatchManager;
import com.one.blocks.rbac.domain.SysUserAccount;
import com.one.blocks.rbac.mapper.SysUserAccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author <a href="mailto:idler41@163.con">idler41</a> created on 2022-05-01 10:06:14
 */
@Service
public class SysUserAccountManager extends AbstractBatchManager<SysUserAccountMapper, SysUserAccount> {

    @Autowired
    public SysUserAccountManager(SysUserAccountMapper mapper) {
        super(mapper);
    }

    public Integer selectDefaultAccount(Integer adminUserId) {
        // 后续改为具体的sql
        SysUserAccount param = new SysUserAccount();
        param.setUserId(adminUserId);
        SysUserAccount sysUserAccount = mapper.selectOne(param);
        return sysUserAccount == null ? null : sysUserAccount.getAccountId();
    }

}